package com.imooc.flink;

import org.apache.flink.api.java.ExecutionEnvironment;
import org.apache.flink.configuration.Configuration;

public class SourceApp {

    public static void main(String[] args) throws Exception {
        ExecutionEnvironment environment = ExecutionEnvironment.getExecutionEnvironment();

        //CSV读取
        environment.readCsvFile("data/people.csv")
                .fieldDelimiter(";")
                .ignoreFirstLine()
                .types(String.class, Integer.class, String.class)
                .print();

//        //txt文件读取
//        environment.readTextFile("data/wc.txt").print();
//
//        //压缩文件读取
//        environment.readTextFile("data/wc.txt.gz").print();
//
//        //递归读取子目录文件内容
//        Configuration configuration = new Configuration();
//        configuration.setBoolean("recursive.file.enumeration", true);
//        environment.readTextFile("data/nest")
//                .withParameters(configuration)
//                .print();
    }
}
